<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>脚本</title>
</head>
<body>

<div id="namexing">林俊杰</div>

<button type="button" onclick="onclickAction()">onclick</button>
<input type="button" onclick="onclickAction()" value="onclick">

</body>

<script>

<!--   1. 插入脚本-->

    document.write("xingweixin");

//2.在HTML出入入内容

    document.write("<h1>插入一个标题</h1>" );
    document.write("<p>插入一个段落</p>");

    //3.添加方法
    function onclickAction() {

        alert("123");
        document.getElementById("namexing").innerHTML = "爱笑的眼睛";
        document.getElementById("namexing").style.color= "red";
    }

</script>

</html>